<template>
  <div class="box">
    <header class="header">购物车</header>
    <div class="content">
      读取 -> 有 -> 渲染<br>
      读取 -> 没有 -> 显示空提示 -> 引导用户，浏览器商品
    </div>
  </div>
</template>

<script>
export default {
  beforeRouteEnter (to, from, next) {
    if (localStorage.getItem('isLogin') === 'ok') {
      next()
    } else {
      next('/login?to=' + to.path)
    }
  }
}
</script>

<style>
</style>
